home *** CD-ROM | disk | FTP | other *** search
/ Teach Your Children: Road Construction Ahead / Teach Your Children: Road Construction Ahead.iso / pc / rca / road.dxr / 00096_invisibleSimButScript.ls < prev    next >
Encoding:
Text File  |  1996-07-17  |  1.6 KB  |  50 lines

  1. global gSimObject, gTruckObject, gRollAnimButton
  2.  
  3. on mouseDown
  4.   if not objectp(gRollAnimButton) and (the status of gTruckObject <> #animating) then
  5.     startBuffering()
  6.     set whichbutton to the clickOn - the firstInvisButChan of gSimObject + 1
  7.     set vector to getAt(the arrowList of gSimObject, whichbutton)
  8.     set cellNum to the cell of gTruckObject + getProp(the moveList of gSimObject, vector)
  9.     surroundStaticSprite(gSimObject, cellNum, the cell of gTruckObject)
  10.     updateStage()
  11.     set hiliteChan to the invisibleButHiliteChan of gSimObject
  12.     set startx to the locH of sprite the clickOn
  13.     set the locH of sprite hiliteChan to startx
  14.     set the locV of sprite hiliteChan to the locV of sprite the clickOn
  15.     set the castNum of sprite hiliteChan to the invisibleButHiliteBmap of gSimObject
  16.     updateStage()
  17.     startTimer()
  18.     set pressed to 1
  19.     repeat while the mouseDown
  20.       if rollOver(the clickOn) then
  21.         if pressed = 0 then
  22.           set the locH of sprite hiliteChan to startx
  23.           updateStage()
  24.           set pressed to 1
  25.         end if
  26.         next repeat
  27.       end if
  28.       if pressed = 1 then
  29.         set the locH of sprite hiliteChan to 1000
  30.         updateStage()
  31.         set pressed to 0
  32.       end if
  33.     end repeat
  34.     if pressed = 1 then
  35.       puppetSound("arrowClick")
  36.       updateStage()
  37.       repeat while soundBusy(1)
  38.       end repeat
  39.       puppetSound(0)
  40.       set the locH of sprite hiliteChan to 1000
  41.       updateStage()
  42.       if the startSimFlag of gSimObject = 1 then
  43.         set the startSimFlag of gSimObject to 0
  44.       end if
  45.       moveTruck(gTruckObject, vector)
  46.     end if
  47.     flushBuffer()
  48.   end if
  49. end
  50.